#include "MThreadPool.h"
#include <thread>


MThreadPool * MThreadPool::GetInstace()
{
	static MThreadPool pool;
	return &pool;
}

void MThreadPool::Init(int count)
{
	this->m_count = count;
}

bool MThreadPool::Start()
{
	for (int i = 0; i < m_count; i++)
	{
		std::thread th(std::bind(&Worker::run, m_work));
		th.detach();
	}
	
	return true;
}

bool MThreadPool::Stop()
{
	return false;
}

MThreadPool::MThreadPool()
{
}


MThreadPool::~MThreadPool()
{
}
